﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;

namespace Mpfr.Structs
{
  public unsafe class mpfr_t : IDisposable
  {
    internal __mpfr_struct* mpfr_ptr;

    public mpfr_t()
    {
      mpfr_ptr = (__mpfr_struct*)Marshal.AllocHGlobal(sizeof(__mpfr_struct));
    }

    ~mpfr_t()
    {
      Dispose();
    }

    public void Dispose()
    {
      if (mpfr_ptr != null)
      {
        Marshal.FreeHGlobal((IntPtr)mpfr_ptr);
        mpfr_ptr = null;
      }
    }
  }
}
